package rest.jbpm.wrappers.lists;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import rest.jbpm.wrappers.Group;

@XmlRootElement(name="groups")
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlType(name = "group", propOrder = {"groups"})
public class GroupList {

	private List<Group> groups = new ArrayList<Group>();
		
	protected GroupList() {
		
	}
	
	public GroupList(List<org.jbpm.api.identity.Group> grps) {
		
		for(org.jbpm.api.identity.Group grp : grps)
			groups.add(new Group(grp));

	}
	
	@XmlElement(name="group",required=true)
	public List<Group> getGroups() {
		return groups;
	}

}
